import 'dart:core';

class User {
  late int? id;
  late String? username;
  late String? sex;
  late String? phone;
  late String? avatar;
  late int? times;
  late String? createTime;
  late String? updateTime;
  late String? birthday;
  late String? zodiac;
  late String? vipTime;

  User({
    this.id,
    this.username,
    this.sex,
    this.phone,
    this.avatar,
    this.times,
    this.createTime,
    this.updateTime,
    this.birthday,
    this.zodiac,
    this.vipTime,
  });

  void fromJson(Map<String, dynamic> json) {
    id = json['id'];
    username = json['username'];
    sex = json['sex'];
    phone = json['phone'];
    avatar = json['avatar'];
    times = json['times'];
    createTime = json['createTime'];
    updateTime = json['updateTime'];
    birthday = json['birthday'];
    zodiac = json['zodiac'];
    vipTime = json['vipTime'];
  }

  User.fromJson(Map<String, dynamic> json) {
    fromJson(json);
  }

  set setAvatar(String? value) {
    avatar = value;
  }
  set setUsername(String? value) {
    username = value;
  }
  set setVipTime(String? value) {
    vipTime = value;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['username'] = username;
    data['sex'] = sex;
    data['phone'] = phone;
    data['avatar'] = avatar;
    data['times'] = times;
    data['createTime'] = createTime;
    data['updateTime'] = updateTime;
    data['birthday'] = birthday;
    data['zodiac'] = zodiac;
    data['vipTime'] = vipTime;
    return data;
  }
}

class QiNiuResponseModel {
  late String url;
  String? key;
  String? width;
  String? height;
  double? ratio;
  String? fsize;
  String? duration;
  String? fname;
  String? mimeType;
  String? ext;
  String? type;
  String? decibels;
  int? orientation;
  int? roomId;
  int? msgId;


  QiNiuResponseModel({
    required this.url,
    this.key,
    this.width,
    this.height,
    this.ratio,
    this.fsize,
    this.duration,
    this.fname,
    this.mimeType,
    this.ext,
    this.type,
    this.decibels,
    this.orientation,
    this.roomId,
    this.msgId,
  });

  QiNiuResponseModel.fromJson(Map<String, dynamic> json) {
    url = json['url'];
    key = json['key'];
    width = json['width'];
    height = json['height'];
    ratio = json['ratio'] != null ? double.parse(json['ratio'].toString()) : json['ratio'];
    fsize = json['fsize'];
    duration = json['duration'];
    fname = json['fname'];
    mimeType = json['mimeType'];
    ext = json['ext'];
    type = json['type'];
    decibels = json['decibels'];
    orientation = json['orientation'];
    roomId = json['roomId'];
    msgId = json['msgId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['url'] = url;
    data['key'] = key;
    data['width'] = width;
    data['height'] = height;
    data['ratio'] = ratio;
    data['fsize'] = fsize;
    data['duration'] = duration;
    data['fname'] = fname;
    data['mimeType'] = mimeType;
    data['ext'] = ext;
    data['type'] = type;
    data['decibels'] = decibels;
    data['orientation'] = orientation;
    data['roomId'] = roomId;
    data['msgId'] = msgId;
    return data;
  }
}

/// 公用page请求类
class CommonPage {
  late int page;
  late int size;

  CommonPage({
    required this.page,
    required this.size,
  });

  CommonPage.fromJson(Map<String, dynamic> json) {
    page = json['page'];
    size = json['size'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['page'] = page;
    data['size'] = size;
    return data;
  }
}
/// /user/update 接口请求数据model
class UserUpdateAPIData extends User {
  UserUpdateAPIData({
    String? username,
    String? sex,
    String? phone,
    String? avatar,
    String? birthday,
    String? zodiac,
  }) : super(
    username: username,
    sex: sex,
    phone: phone,
    avatar: avatar,
    birthday: birthday,
    zodiac: zodiac,
  );

  UserUpdateAPIData.fromJson(Map<String, dynamic> json) : super.fromJson(json);

  @override
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['username'] = username;
    data['sex'] = sex;
    data['phone'] = phone;
    data['avatar'] = avatar;
    data['birthday'] = birthday;
    data['zodiac'] = zodiac;
    return data;
  }
}
/// /user/modifyUserInfo 接口请求数据model
class UserEditAPIData extends User {
  UserEditAPIData({
    String? username,
    String? avatar,
  }) : super(
    username: username,
    avatar: avatar,
  );

  UserEditAPIData.fromJson(Map<String, dynamic> json) : super.fromJson(json);

  @override
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['username'] = username;
    data['avatar'] = avatar;
    return data;
  }
}
/// /records/add 接口请求数据model
class GeomancyAddAPIData {
  late String type;// 类型  compassSourceValues
  late String deg;//	角度
  String? birthday;//	出生年月日
  String? sex;// 性别

  GeomancyAddAPIData({
    required this.type,
    required this.deg,
    this.birthday,
    this.sex,
  });

  GeomancyAddAPIData.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    deg = json['deg'];
    birthday = json['birthday'];
    sex = json['sex'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['type'] = type;
    data['deg'] = deg;
    data['birthday'] = birthday;
    data['sex'] = sex;
    return data;
  }
}
